<!--
 - MineAdmin is committed to providing solutions for quickly building web applications
 - Please view the LICENSE file that was distributed with this source code,
 - For the full copyright and license information.
 - Thank you very much for using MineAdmin.
 -
 - @Author X.Mo<root@imoi.cn>
 - @Link   https://gitee.com/xmo/mineadmin-vue
-->
<template>
  <div class="ma-content-block  justify-between p-4">




    <ma-form
        ref="formRef"
        v-model="form"
        :columns="columns"
        class="mt-7"
        @submit="submitConfig"
    ></ma-form>





  </div>
</template>

<script setup>
import { ref, reactive, onMounted, watch } from 'vue'
import MaUpload from '@cps/ma-upload/index.vue'
import infoClass from '@/api/info/infoClass'
import { Message } from '@arco-design/web-vue'
const initData=async ()=> {
  const response = await infoClass.getInitConfig2();
  form.value.culture_title=response.data.culture_title
  form.value.culture_title_img=response.data.culture_title_img
  form.value.culture_desc=response.data.culture_desc
  form.value.culture_icon=response.data.culture_icon
  form.value.culture_right_img=response.data.culture_right_img

}
initData();
const submitConfig = async ({ values, errors }) => {
  const response=await infoClass.submitConfig2(form.value);
  if(response.success){
    Message.success(response.message)
  }else{
    Message.error(response.message)
  }
}

const form = ref({
  culture_title:'',
  culture_title_img:'',
  culture_desc:'',
  culture_icon:'',
  culture_right_img:''
})
const columns = reactive([
  {
    title: "标题",
    dataIndex: "culture_title",
    width:280,
    formType: "input",
    editDisplay: false,
    hide:true
  },
  {
    title: '图片标题',
    dataIndex: 'culture_title_img',
    formType: "upload",
    onlyData: true,
    returnType: "url",
    multiple: false,
    chunk: false,
    type: "image",
    hide: true

  },
  {
    title: "描述",
    dataIndex: "culture_desc",
    formType: "textarea",
    hide: true
  },
  {
    title: "下图标",
    dataIndex: "culture_icon",
    formType: "upload",
    onlyData: true,
    returnType: "url",
    multiple: false,
    chunk: false,
    type: "image",
    hide: true
  },
  {
    title: "右侧图片",
    dataIndex: "culture_right_img",
    formType: "upload",
    onlyData: true,
    returnType: "url",
    multiple: false,
    chunk: false,
    type: "image",
    hide: true
  }
  ])





</script>
<script>
export default { name: 'userCenter' }
</script>

<style scoped>
.avatar-box {
  width: 130px;
}
.user-header {
  width: 100%;
  height: 200px;
  background: url('@/assets/userBanner.jpg') no-repeat;
  background-size: cover;
}
</style>
